///inventory_draw();
draw_set_alpha(0.3);
draw_set_color(c_black);
draw_rectangle(0,0,global.width,global.height,0);

var xx,yy,w,h;
xx=inventory_x-hudburn;
yy=inventory_y-hudburn;
w=inventory_w+hudburn;
h=inventory_h+hudburn;
draw_set_alpha(math_percentage_one(hudburn,global.width/50)-0.4);
draw_set_color(c_blue);
draw_rectangle(xx,yy,w,h,0);

var perc,slotx,sloty;
perc=math_percentage_match(55,w-xx);
slotx=perc/4;
sloty=perc/8;

draw_set_color(c_yellow);
draw_sprite_stretched(sprInventorySlot,0,w-10-slotx,yy+10,slotx,sloty); ///slot4
draw_sprite_stretched(sprInventorySlot,0,w-20-(slotx*2),yy+10,slotx,sloty); ///slot3
draw_sprite_stretched(sprInventorySlot,0,w-30-(slotx*3),yy+10,slotx,sloty); ///slot2
draw_sprite_stretched(sprInventorySlot,0,w-40-(slotx*4),yy+10,slotx,sloty); ///slot1
draw_sprite_stretched(sprInventorySlot,0,w-10-slotx,yy+20+sloty,slotx,sloty); ///slot8
draw_sprite_stretched(sprInventorySlot,0,w-20-(slotx*2),yy+20+sloty,slotx,sloty); ///slot7
draw_sprite_stretched(sprInventorySlot,0,w-30-(slotx*3),yy+20+sloty,slotx,sloty); ///slot6
draw_sprite_stretched(sprInventorySlot,0,w-40-(slotx*4),yy+20+sloty,slotx,sloty); ///slot5

draw_set_alpha(math_percentage_one(objHUD.hudburn,global.width/50)-0.2);
///Draw Item Sprites
if (objController.inventory[4]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(4)),0,w-10-slotx+2,yy+10+2,slotx-4,sloty-4);
}

if (objController.inventory[3]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(3)),0,w-20-(slotx*2)+2,yy+10+2,slotx-4,sloty-4);
}

if (objController.inventory[2]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(2)),0,w-30-(slotx*3)+2,yy+10+2,slotx-4,sloty-4);
}

if (objController.inventory[1]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(1)),0,w-40-(slotx*4)+2,yy+10+2,slotx-4,sloty-4);
}

if (objController.inventory[8]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(8)),0,w-10-slotx+2,yy+20+sloty+2,slotx-4,sloty-4);
}

if (objController.inventory[7]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(7)),0,w-20-(slotx*2)+2,yy+20+sloty+2,slotx-4,sloty-4);
}

if (objController.inventory[6]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(6)),0,w-30-(slotx*3)+2,yy+20+sloty+2,slotx-4,sloty-4);
}

if (objController.inventory[5]!=-1)
{
draw_sprite_stretched(item_info_sprite(inventory_item_id(5)),0,w-40-(slotx*4)+2,yy+20+sloty+2,slotx-4,sloty-4);
}
